package com.qk.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RoleMapper {
    //@Select("select id, name, label, remark, create_time, update_time from role where name like concat('%',#{name},'%') and label like concat('%',#{label},'%')")
    List<Role> select(String name, String label);

    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);

    @Select("select id, name, label, remark, create_time, update_time from role where id=#{id}")
    Role getById(Integer id);


    void update(Role role);

    @Delete("delete from role where id= #{id}")
    void delete(Integer id);

    @Select("select id, name, label, remark, create_time, update_time from role")
    List<Role> getAllList();
}
